package com.jcbase.controller;

import java.util.List;

import com.jcbase.core.auth.interceptor.AuthorityInterceptor;
import com.jcbase.core.auth.interceptor.SysLogInterceptor;
import com.jcbase.core.controller.JCBaseController;
import com.jcbase.core.weixin.interceptor.Oauth2Interceptor;
import com.jcbase.model.RisebdCity;
import com.jcbase.model.RisebdProductType;
import com.jfinal.aop.Before;
import com.jfinal.aop.Clear;

@Before(Oauth2Interceptor.class)
@Clear({ AuthorityInterceptor.class, SysLogInterceptor.class })
public class IndexController extends JCBaseController {

	public void index() {
		//String openid = getCookie(BaseConstance.OPENID_COOKIE_KEY);
		//得到大类
		List<RisebdProductType> productTypes = RisebdProductType.me.getMainProductType();
		setAttr("productTypes", productTypes);
		//得到城市列表
		List<RisebdCity> risebdCities = RisebdCity.me.getAllAvailableCity();
		setAttr("risebdCities", risebdCities);
		render("index.jsp");
	}
}
